/**
 * 
 */
package sv.gob.mh.dgii.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author melvin.henriquez
 * 
 */
@Entity
@Table(name = "DV_PAGO_INDEB_RENTA_DET", schema = "DEVOLUCIONES")
public class DvPagoIndebRentaDet implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3598502346238362464L;
	private DvPagoIndebRentaDetId id;
	private Date fpobligacion;
	private Double vmontoOriginal;
	private Date fpobligacionModif;
	private Double vmontoModificatoria;
	private Double vmontoIndebido;
	private DvPagoIndebRenta dvPagoIndebRenta;

	public DvPagoIndebRentaDet() {
		// TODO Auto-generated constructor stub
	}

	public DvPagoIndebRentaDet(DvPagoIndebRentaDetId id, Date fpobligacion,
			Double vmontoOriginal, Date fpobligacionModif,
			Double vmontoModificatoria, Double vmontoIndebido) {
		this.id = id;
		this.fpobligacion = fpobligacion;
		this.vmontoOriginal = vmontoOriginal;
		this.fpobligacionModif = fpobligacionModif;
		this.vmontoModificatoria = vmontoModificatoria;
		this.vmontoIndebido = vmontoIndebido;
	}

	/**
	 * @return the id
	 */
	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "iindice", column = @Column(name = "I_INDICE", nullable = false, precision = 18, scale = 0)),
			@AttributeOverride(name = "ncorrelativo", column = @Column(name = "N_CORRELATIVO", nullable = false, precision = 18, scale = 0)) })
	public DvPagoIndebRentaDetId getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(DvPagoIndebRentaDetId id) {
		this.id = id;
	}

	/**
	 * @return the fpobligacion
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(insertable = true, name = "FP_OBLIGACION", length = 7, nullable = false, updatable = true)
	public Date getFpobligacion() {
		return fpobligacion;
	}

	/**
	 * @param fpobligacion
	 *            the fpobligacion to set
	 */
	public void setFpobligacion(Date fpobligacion) {
		this.fpobligacion = fpobligacion;
	}

	/**
	 * @return the vmontoOriginal
	 */
	@Column(name = "V_MONTO_ORIGINAL", nullable = true, precision = 12, scale = 2)
	public Double getVmontoOriginal() {
		return vmontoOriginal;
	}

	/**
	 * @param vmontoOriginal
	 *            the vmontoOriginal to set
	 */
	public void setVmontoOriginal(Double vmontoOriginal) {
		this.vmontoOriginal = vmontoOriginal;
	}

	/**
	 * @return the fpobligacionModif
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(insertable = true, name = "FP_OBLIGACION_MODIF", length = 7, nullable = false, updatable = true)
	public Date getFpobligacionModif() {
		return fpobligacionModif;
	}

	/**
	 * @param fpobligacionModif
	 *            the fpobligacionModif to set
	 */
	public void setFpobligacionModif(Date fpobligacionModif) {
		this.fpobligacionModif = fpobligacionModif;
	}

	/**
	 * @return the vmontoModificatoria
	 */
	@Column(name = "V_MONTO_MODIFICATORIA", nullable = true, precision = 12, scale = 2)
	public Double getVmontoModificatoria() {
		return vmontoModificatoria;
	}

	/**
	 * @param vmontoModificatoria
	 *            the vmontoModificatoria to set
	 */
	public void setVmontoModificatoria(Double vmontoModificatoria) {
		this.vmontoModificatoria = vmontoModificatoria;
	}

	/**
	 * @return the vmontoIndebido
	 */
	@Column(name = "V_MONTO_INDEBIDO", nullable = true, precision = 12, scale = 2)
	public Double getVmontoIndebido() {
		return vmontoIndebido;
	}

	/**
	 * @param vmontoIndebido
	 *            the vmontoIndebido to set
	 */
	public void setVmontoIndebido(Double vmontoIndebido) {
		this.vmontoIndebido = vmontoIndebido;
	}

	/**
	 * @return the dvPagoIndebRenta
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "I_INDICE", nullable = false, insertable = false, updatable = false)
	public DvPagoIndebRenta getDvPagoIndebRenta() {
		return dvPagoIndebRenta;
	}

	/**
	 * @param dvPagoIndebRenta
	 *            the dvPagoIndebRenta to set
	 */
	public void setDvPagoIndebRenta(DvPagoIndebRenta dvPagoIndebRenta) {
		this.dvPagoIndebRenta = dvPagoIndebRenta;
	}

}
